<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        //倒置字符串
        function rev(str) {
            let arr = [];
            for (let i = str.length-1; i >= 0; i--) {
                arr.push(str.charAt(i));
            }
            return arr.join("");
        }

        console.log(rev("jake"))
    </script>
</body>
</html>